home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / ExitLoop.au3 < prev    next >
Encoding:
Text File  |  2006-06-17  |  259 b   |  9 lines

  1. $sum = 0
  2. While 1 ;use infinite loop since ExitLoop will get called
  3.     $ans = InputBox("Running total=" & $sum, _
  4.         "    Enter a positive number.  (A negative number exits)")
  5.     If $ans < 0 Then ExitLoop
  6.     $sum = $sum + $ans
  7. WEnd
  8. MsgBox(0,"The sum was", $sum)
  9.